<include file="../Public/plugin.header.html" />
<link href="__PUBLIC__/Css/plugin-gift.css" rel="stylesheet" type="text/css">

<link href="__PUBLIC__/Js/jTip/css/global.css" rel="stylesheet" type="text/css">

<script src="__PUBLIC__/Js/jTip/js/jtip.js" type="text/javascript"></script>

<script type="text/javascript">
	var todaydate = '<?php echo date( 'Y-m-d',time() );?>';
	$(function(){
		resizeFull();
		window.onload=resizeFull;
		window.onresize=resizeFull;
		
		order_countMoney();/** 初始化：计算账单 **/
		order_refreshReceiver();/** 初始化：设置收礼人输入区 **/
		order_initSender();
	});
		
	
	/** 刷新接收者录入部分 **/
	function order_refreshReceiver(){
		$('#order_receivers tbody tr').each( function(i, tr){
       		//tr=$(this_).parent().parent();
       		var objno = $(tr).find('#no');
       		objno.attr('rel',i+1);
       		objno.html((i+1)+'.');
       		$(tr).removeClass('tr_bg');
       		if(i%2==1)$(tr).addClass('tr_bg');
       		order_refreshSendHour($(tr).find('#send_hour')
										       			,$(tr).find('#send_date').val()
										       			);
       	});
       
       	order_receiverAddEvent();
	}
	
	function order_checkSendDate(senddate_){
		//alert(senddate_);
		var result = false;
		var shelf_off_time_ = $('#order_shelf_baseinfo').find('#shelf_off_time').val();
		//alert(shelf_off_time_ +"  "+ senddate_+"  "+todaydate);
		if(senddate_>=todaydate&&senddate_<shelf_off_time_){
			result = true;
		}else{
			if(senddate_<todaydate){
				k_error('发送日期不能小于当前日期！');
			}
			if(senddate_>=shelf_off_time_){
				k_error('发送日期不能大于下架日期！');
			}
		}
		return result;
	}
	
	/** 接收者总数 **/
	function order_totalReceiver(){
		return $('#order_receivers tbody tr').size();
	}
	
	
	/** 给接收者table添加事件 **/
	function order_receiverAddEvent(){
		$('#order_receivers tbody tr').each( function(i, tr){
       						//reveiver_mobile  send_no  send_date  send_hour
       						var jobj = $(tr);
       						jobj.find('#send_date').focus(
       										function(){
       												rcalendar(	this
       															,''
       															,function(date,this_){
       																var m = date.getMonth() + 1 < 10 ? '0' + 
       																		(date.getMonth() + 1) : date.getMonth() + 1;
       																var d = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
       																var val = date.getFullYear() + "-" + m + "-" + d;
       																var result = order_checkSendDate(val);
       																if(result==false){
       																	//alert(11);
										       							$(this_).val(todaydate);
										       							$(this_).focus();
										       						}
										       						order_refreshSendHour($(this_).parent().parent().find('#send_hour')
										       											,$(this_).val()
										       						);
       															}
       												);
       										}
       						);
       		
       						jobj.find('#send_no').change(
       										function(){
       												order_countMoney();
       										}
       						);
       		
       						k_inputIntOnly(jobj.find('#reveiver_mobile'));
       		
       						jobj.find('#reveiver_mobile').blur(
       										function(){
       												$('#pbook_list').fadeOut("fast");
       												$(this).removeClass('tmp_alert_bg');
       												var mobile = jQuery.trim($(this).val());
       												$(this).val(mobile);
       												//alert($(this).val());
       												if(mobile==''){
       													//k_error('请填写收礼人手机号码！');
       													$(this).attr('title','请填写收礼人手机号码！');
       													$(this).addClass('tmp_alert_bg');
       													return;
       												}
       												var result = k_check_mobile(mobile);
       												//alert(result);
       												if(result==false){
       													//k_error('请填写正确的收礼人手机号码！');
       													$(this).attr('title','请填写正确的收礼人手机号码！');
       													$(this).addClass('tmp_alert_bg');
										     	  	}
       												order_countMoney();
       										}
       						);
       						/**
       						jobj.find('#reveiver_mobile').focus( function(){ $(this).keyup(); } );
       						//添加同步查询电话薄
       						
       						jobj.find('#reveiver_mobile').unbind("keyup");
       						jobj.find('#reveiver_mobile').bind("keyup",function(){
       											var current_obj = $(this);
       											var mobile_ = jQuery.trim(current_obj.val());
				       							$.kajax({      
				       					    		ajx_rtn_type:'JSON',
				       					    		url:"{:U('User://Account/ajxSearchPbook')}",      
				       					    		type:'post', //数据发送方式  
				       					    		data:{mobile:mobile_} ,    
				       					    		async: false ,//同步方式     
				       					    		success: function(objson){
				       					    				var html_="";
				       					    				var pbook_list = $('#pbook_list');
				       					    				var result = objson.data;
				       					    				if(result==null||result=='null'){
				       					    					
				       					    				}else{
						       					    			for(i=0;i<result.length;i++){
						       					    				html_ = html_+'<a style="margin-top:3px" href="javascript:void(0)" rel="'+result[i].mobile+'" id="'+result[i].id+'">'+
						       					    				result[i].mobile+'&nbsp;&nbsp;&nbsp;&nbsp;'+result[i].name+'</a><br>';
							       					    		}
				       					    				}
						       					    		if(html_==""){
						       					    			pbook_list.fadeOut("fast");
						       					    			pbook_list.html(html_);
						       					    		}else{
						       					    			pbook_list.html(html_);
						       					    			var position = current_obj.offset();
						       					    			pbook_list.css({"top":(position.top+23)+"px","left":position.left+"px"});
						       					    			pbook_list.fadeIn("fast");
						       					    		}
						       					    		pbook_list.find('a').each( function(i, elm){
						       					    			$(elm).unbind("click");
						       					    			$(elm).bind('click',function(){
						       					    											current_obj.removeClass("tmp_alert_bg");
						       					    											current_obj.attr("title",'');
						       					    											current_obj.attr("rel",$(this).attr('id'));
						       					    											current_obj.val($(this).attr('rel'));
						       					    											pbook_list.fadeOut("fast");
						       					    											order_countMoney();
						       					    						});
						       					    		});
					       					    		}
				       					    	});
       						});
       						**/
       		
      	});
	}
	
	
	/** 设置发送人相关控件属性 **/
	function order_initSender(){
		var jobj = $('#order_senderinfo');
			
		k_inputIntOnly(jobj.find('#sender_mobile'));
		jobj.find('#sender_mobile').blur(
       									function(){
       											$(this).removeClass('tmp_alert_bg');
       											var mobile = jQuery.trim($(this).val());
       											$(this).val(mobile);
       											//alert($(this).val());
       											if(mobile==''){
       												k_error('请填写送礼人手机号码！');
       												$(this).addClass('tmp_alert_bg');
       												return;
       											}
       											var result = k_check_mobile(mobile);
       											//alert(result);
       											if(result==false){
       												k_error('请填写正确的送礼人手机号码！');
       												$(this).addClass('tmp_alert_bg');
										       	}
       									}
      	);
		jobj.find('#sender_name').blur(
					function(){
							$(this).removeClass('tmp_alert_bg');
							var sname = jQuery.trim($(this).val());
							$(this).val(sname);
							//alert($(this).val());
							if(sname==''){
								k_error('请填写送礼人名称！');
								$(this).addClass('tmp_alert_bg');
								return;
							}
							
							var max = parseInt($(this).attr("maxlength"), 10); //获取maxlength的值 转化为10进制，将输入到textarea的文本长度
				            //这个判断可知max得到的是不是数字，设定的大小是多少
				            if (max > 0) {
				                if (sname.length > max) { //textarea的文本长度大于maxlength
				                	$(this).val($(this).val().substr(0, max)); //截断textarea的文本重新赋值
				                }
				            }
							
					}
		);
      
      	jobj.find('#send_format').change(
      										function(){
      												if($(this).val()=='no'){
																	$('#sender_txt_edit').hide();
																	$('#sender_sms_edit').hide();
															}
															if($(this).val()=='sms'){
																	$('#sender_txt_edit').fadeIn("fast");
																	$('#sender_sms_edit').hide();
															}
															if($(this).val()=='mms'){
																	$('#sender_txt_edit').hide();
																	$('#sender_sms_edit').fadeIn("fast");
															}
													}
      );
      $('#sender_txt_edit').find('#txt_content').keyup(function() {
            var area = $(this);
            //parseInt 方法返回与保存在 numString 中的数字值相等的整数。如果 numString 的前缀不能解释为整数，则返回 NaN（而不是数字）。
            var max = parseInt(area.attr("maxlength"), 10); //获取maxlength的值 转化为10进制，将输入到textarea的文本长度
            //这个判断可知max得到的是不是数字，设定的大小是多少
            if (max > 0) {
                if (area.val().length > max) { //textarea的文本长度大于maxlength
                    area.val(area.val().substr(0, max)); //截断textarea的文本重新赋值
                }
            }
            $('#sms_input_no').html(40-area.val().length);
      });
      $('#sender_txt_edit').find('#txt_content').blur(function() {
            var area = $(this);
            var max = parseInt(area.attr("maxlength"), 10); //获取maxlength的值
            if (max > 0) {
                if (area.val().length > max) { //textarea的文本长度大于maxlength
                    area.val(area.val().substr(0, max)); //截断textarea的文本重新赋值
                }
            }
      });
	}
	
	/** 刷新发送时间 **/
	function order_refreshSendHour(jobj_,senddate_){
		var selectval_=jobj_.val();
		jobj_.empty();
		jobj_.append('<option value="11" >11点发送</option>');
		jobj_.append('<option value="17" >17点发送</option>');
		jobj_.append('<option value="22" >22点发送</option>');
		//alert(senddate_+"  "+todaydate);
		if(senddate_==todaydate){
			jobj_.prepend('<option value="7" >&nbsp;7点发送</option>');
			jobj_.append('<option value="0" selected="selected">即刻发送</option>');
		}else{
			jobj_.prepend('<option value="7" selected="selected">&nbsp;7点发送</option>');
		}
		if(selectval_!=null&&selectval_!='')
		  	jobj_.val(selectval_);                                
	}
	
	/** 删除行 **/
	function order_deleteReceiver(this_){
		var total = order_totalReceiver();
		if(total==1){k_error('最少需录入一个收礼人！');return;}
		var currentRow=$(this_).parent().parent();
		currentRow.remove();
		order_refreshReceiver();
		order_countMoney();
	}
	
	/** 添加接收者 **/
	function order_addReceiver(this_){
		var max_receiverno=5;
		var total = order_totalReceiver();
		if(total>=max_receiverno){k_error('最多可录入'+max_receiverno+'个收礼人！');return;}
		var currentRow=$(this_).parent().parent();
		var no = currentRow.find('#no').attr('rel');
		no = parseInt(no);
		var str = currentRow.html();
      	str = "<tr>"+str+"</tr>";
      	//alert(str);
      	//当前行之后插入一行
      	currentRow.after(str);
      	order_refreshReceiver();
      	order_countMoney();
	}
	
	/**重新计算总价**/
	function order_countMoney(){
		var Jreceivers_tr = $('#order_receivers tbody tr');
		var needed_pay_			=	0;
		var total_price_		=	0;
		var total_send_no_ 	=	0;
		var total_gain_credit_ = 0;
		var shelf_out_price_ = parseFloat($('#order_shelf_baseinfo').find('#shelf_out_price').val());
		var shelf_gain_credit_ = $('#order_shelf_baseinfo').find('#shelf_gain_credit').val();
		Jreceivers_tr.each( function(i, tr){
			var Jtr = $(tr);
			var reveiver_mobile = Jtr.find('#reveiver_mobile').val();
			if(reveiver_mobile=='')return;
			checkresult = k_check_mobile(reveiver_mobile);
			//选择录入多个手机号码，只录入则通过验证
			if(!checkresult){
				return;
			}
       		total_send_no_ = total_send_no_+parseInt(Jtr.find('#send_no').val());
      	});
      	total_price_ = parseFloat(shelf_out_price_*total_send_no_).toFixed(2);
     	total_gain_credit_ = shelf_gain_credit_*total_send_no_;
     	// total_price_ = formatFloat(shelf_out_price_*total_send_no_,2);
      	needed_pay_ = total_price_;
      	$('#paymentinfo').find('#total_send_no').text(total_send_no_);
      	$('#paymentinfo').find('#total_price').text(total_price_);
      	$('#paymentinfo').find('#total_gain_credit').text(total_gain_credit_);
      	$('#needed_pay').text(needed_pay_);
	}
	
	
	/** 提交前的数据检查 **/
	function order_checksubmit(){
		var Jreceivers_tr = $('#order_receivers tbody tr');
		var Jsender_div		= $('#order_senderinfo');
		var receiver_no 	= Jreceivers_tr.size();//接收者数量，暂时不用该方式计算
		var receiver_data = '';//数据以','分割，每个接受者用':'分割。
		var ifhaserror 		= false;
		//ifneedalert 	= false;
		var result = true;
		var receiver_no = 0;
		Jreceivers_tr.each( function(i, tr){
				var Jtr = $(tr);
				var reveiver_mobile = Jtr.find('#reveiver_mobile').val();
				if(reveiver_mobile=='')return;
				var checkresult = k_check_mobile(reveiver_mobile);
				//选择录入多个手机号码，只录入则通过验证
				if(!checkresult){
						Jtr.find('#reveiver_mobile').addClass('tmp_alert_bg');
						ifhaserror = true;
				}
				var fg_ = ':';
				if(i==0)fg_ = '';
				var tmp_data = fg_+reveiver_mobile+','+Jtr.find('#send_no').val()+','+
									 Jtr.find('#send_date').val()+','+Jtr.find('#send_hour').val();
				//reveiver_mobile  send_no  send_date  send_hour
				receiver_data = receiver_data + tmp_data;
				receiver_no = receiver_no+1;
				//alert(receiver_data);
		});
		if(receiver_no==0){
			k_error('至少录入一个收礼人！');
			result = false;
		}
		if(ifhaserror){
			k_error('请填写正确的收礼人手机号码！');
			result = false;
		}
		
		var sender_mobile = Jsender_div.find('#sender_mobile').val();
		var checkresult = k_check_mobile(sender_mobile);
		//选择录入多个手机号码，只录入则通过验证
		if(!checkresult){
				Jsender_div.find('#sender_mobile').addClass('tmp_alert_bg');
				k_error('请填写正确的送礼人手机号码！');
				result = false;
		}
		
		var sender_name = Jsender_div.find('#sender_name').val();
		//选择录入多个手机号码，只录入则通过验证
		if(sender_name==''){
				Jsender_div.find('#sender_name').addClass('tmp_alert_bg');
				k_error('请填写送礼人名称！');
				result = false;
		}
		
		if(result==true){
			var send_format = Jsender_div.find('#send_format').val();
			var txt_content = $('#sender_txt_edit').find('#txt_content').val();
			
			/** 设置上传数据 **/
			$('#orderform').find('#receiver_no').val(receiver_no);
			$('#orderform').find('#receiver_data').val(receiver_data);
			$('#orderform').find('#sender_name').val(sender_name);
			$('#orderform').find('#sender_mobile').val(sender_mobile);
			$('#orderform').find('#send_format').val(send_format);
			$('#orderform').find('#txt_content').val(txt_content);
		}
		return result;
	}
	
	function order_submit(){
		//alert($('#inputtext').scrollHeight);
		var smsdata = getSmsJsonData();
		//alert(smsdata);
		if(smsdata==''){
			//return;
		}else{
			$('#orderform').find('#smsdata').val(smsdata);
		}
		$('#orderform').find('#cardcontent').val($('#inputtext').val())
		//alert($('#orderform').find('#cardcontent').val());
		if(order_checksubmit()){
			$('#orderform').submit();
		}
	}
	
	
	//提交模板预览
	function getSmsJsonData(){
		if($('#smsimg').val()==''){
   			k_error('请选择背景！');
   			return '';
   		}
		/** 获取文字坐标 **/
		var _left = $('#sms_draggable_icon').css('left');
		var _top = $('#sms_draggable_icon').css('top');
     	$('#xyOffset').val(_left+','+_top);
     	
     	$('#smsicon').val($('#sms_draggable_icon').attr('src'));
     	//alert($('#smsicon').val() + " " + $('#textcolor').val() + " " + $('#textxy').val() + " " + $('#smsimg').val() + " " + $('#smstext').val());
		var jsondata = '[{"xyOffset":"'+$('#privewform').find('#xyOffset').val()+'"'+
				    		 ',"smsimg":"'+$('#privewform').find('#smsimg').val()+'"'+
				    		// ',"smstext":"'+$('#privewform').find('#smstext').val()+'"'+
				    		 ',"smsicon":"'+$('#privewform').find('#smsicon').val()+'"'+
				    		 ',"textcolor":"'+$('#privewform').find('#textcolor').val()+'"'+
				    		 '}]'; 
		
  		return jsondata;
	}
</script>

<style>
.tmp_alert_bg{
	background-color: #F7BE81;
}

</style>

<form action="{:U('plugin://order/confirm')}" method="post" id="orderform">
					<input 	type='hidden' id='shelf_id' name='shelf_id'
					 				value="{$productdata['shelf_id']}" >
					<input 	type='hidden' id='receiver_no' name='receiver_no'
					 				value="" >
					<input 	type='hidden' id='receiver_data' name='receiver_data'
					 				value="" >
					<input 	type='hidden' id='sender_name' name='sender_name'
					 				value="" >
					<input 	type='hidden' id='sender_mobile' name='sender_mobile'
					 				value="" >
					<input 	type='hidden' id='send_format' name='send_format'
					 				value="" >
					<input 	type='hidden' id='txt_content' name='txt_content'
					 				value="" >
					<input type='hidden' name='smsdata' id='smsdata' value="">
					<input type='hidden' name='cardcontent' id='cardcontent' value="">
			</form>

<div id="g_plugin_main">
<!--页面主部-->
<div class="p_main" id="p_main">
	<div class="blank10"></div>
	<div class="primary_box">
	<!--主体左部，为商品详情页-->
	<div class="primary_box" id="topbar">
		
		<!--商品概要信息展示，最右上侧-->
		<ul class="info" style="line-height: 22px;">
			<php>//dump($productdata);</php>
			<!--1. 商品名称-->
			<li class="name"><strong>{$productdata['goods_title']}</strong>
			&nbsp;<a title="点击查看该店所有商品" href="{:U('plugin://gift/store',array('bid'=>$productdata['partner_id']))}" class="info_a">
							（{$productdata['partner_title']}）</a>
			</li>
			<!-- 
			<li>商品编号：<b><span id="goods_id">{$productdata['goods_id']}</span></b></li>
			 -->
			<!--3. 市场价，加删除线-->
			<li></li>
			<!--4. 小心意价格-->
			<li>心 意&nbsp;&nbsp;价： <span class="sell" style="font-size:16px;">{:formatMoney($productdata['shelf_out_price'])}</span>
					&nbsp;&nbsp;（市 价： <b class="price">{:formatMoney($productdata['shelf_market_price'])}</b>）
			</li>
			<li>券有效期： <span style="font-size:14px;font-weight:bold;color: #333333;">{:exchangeTimeDesc($productdata['shelf_exchange_time'])}</span></li>
			<li>
				<style>
				.intro_pay p {
				    line-height: 20px;
				}
				</style>
				<div class="details" style=" color: #CC0000;">
					<include file="../Product/Tpl/default/Public/goods_sysm_box.html" />
				</div>
			</li>
		</ul>

<style>
#pic_box .peisong{
	display:block;
 	top: 1px;
    color: #FFFFFF;
    height: 22px;
    left: 1px;
    line-height: 22px;
    position: absolute;
    text-align: right;
    width: 25px;
    z-index: 2;
	font-weight: bold;
}
#pic_box .peisong img {
    height: 58px;
    padding: 0px;
    width: 30px;
}
</style>
		<!--商品图片展示，最左上侧-->
		<div class="pic">
			<!--1. 图片盒，目前共四张，用js来控制显示与否-->
			<div id="pic_box">
				<div style="float: left;">
					<a 	href="#"  class="goods_b"
						title="{$productdata['goods_title']}" >
						<php>if($productdata['goods_get_type']=='delivery'||$productdata['goods_get_type']=='all'){</php>
							<em class="peisong"><img src="__PUBLIC__/Images/global/icon_peisong_1.gif"></em>
						<php>}</php>
						<img src="{:getPhotoFromThumb($productdata['goods_icon'],300,300)}" alt="{$productdata['goods_title']}">	
					</a>
				</div>
			</div>
		</div>
		<div class="clear"></div>
		<div class="blank5"></div>
	</div>
	
	<div class="clear"></div>
	<!-- 订单流程 -->
	<div class="flow_step_no1">
	    <div class="flow_step">
	      <ol class="cols5">
	        <li class="step_1">1.编辑心意券</li>
	        <li class="step_2">2.确认心意券</li>
	        <li class="step_5">3.付款、发送心意券</li>
	      </ol>
	    </div>
	</div>
	
	<!--主体左部，为商品详情页-->
	<div class="primary_box" id="topbar">
			
			<!--数据区-->
			<div style='display:none;' id='order_shelf_baseinfo'>
				<input 	type='hidden' 		value="{$productdata['shelf_id']}"
								id='shelf_id' 		name='shelf_id'>
				<input 	type='hidden' 		value="{$productdata['shelf_out_price']}"
								id='shelf_out_price' 		name='shelf_out_price'>
				<input 	type='hidden' 		value="{$productdata['shelf_total_number']}"
								id='shelf_total_number' 		name='shelf_total_number'>
				<input 	type='hidden' 		value="{$productdata['shelf_send_number']}"
								id='shelf_send_number' 		name='shelf_send_number'>
				<input 	type='hidden' 		value="<?php echo date( 'Y-m-d',$productdata['shelf_off_time'] );?>"
								id='shelf_off_time' 		name='shelf_off_time'>
				<input 	type='hidden' 		value="{$productdata['shelf_gain_credit']}"
								id='shelf_gain_credit' 		name='shelf_gain_credit'>
			</div>
			
			<div id="payment">

				    <!--第二步，编辑发送的彩信信息内容-->
				    	<div class="step">
				        <div class="cont" style=" padding: 15px 0px 0px 0px;">
				        		<span style="float:right;margin-top: 5px;">{:K('SP_COUPON_NM')}将发送到收礼人的手机，请务必正确填写手机号！</span>
				        		<h2 class="subStep">一. 录入收礼人手机号
				        			<a href="#?width=300" class="jTip" id="tip_one" rel='reveiver' name="收礼人录入说明:">
				        			<img style="margin:0px 0px 0px 10px;"	src="/Public/Images/global/icon_help.gif" align="absmiddle" >
					              </a>
					            </h2>
								<div class="panel_style1">
									<div class="receiverInfo">
						                <table class="receiver" id="order_receivers" border="0" cellspacing="0" cellpadding="0" 
						                	style="width: 100%;font-weight: bold;">
						                    <colgroup>
						                        <col width="4%">
						                        <col width="39%">
						                        <col width="20%">
						                        <col width="20%">
						                        <col width="">
						                    </colgroup>
						                    <tbody>
						                    	<php>for($i=1;$i<2;$i++){</php>
						                        <tr <php>if($i%2!=1){</php> class="tr_bg" <php>}</php> >
						                            <td style="text-align:right" id="no" rel="{$i}">{$i}.</td>
						                            <!--手机号码需要验证，位数，前三位是否合法等等-->
						                            <td>
						                            	<font style="font-weight: bold;">手机：</font>
						                            	<input 	type="text" maxLength='11' id="reveiver_mobile" class="inputText">
						                            </td>
						                            <td><font style="font-weight: bold;">数量：</font>
						                            	<select	id="send_no" class="inputText" style="height: 22px; width: 45px;">
						                                    <option value="1" selected="selected" >1</option>
						                                    <option value="2" >2</option>
						                                    <option value="3" >3</option>
						                                    <option value="4" >4</option>
						                                    <option value="5" >5</option>
						                                    <option value="6" >6</option>
						                                    <option value="7" >7</option>
						                                    <option value="8" >8</option>
						                                    <option value="9" >9</option>
						                                    <option value="10" >10</option>
						                                    <option value="11" >11</option>
						                                    <option value="12" >12</option>
						                                    <option value="13" >13</option>
						                                    <option value="14" >14</option>
						                                    <option value="15" >15</option>
						                                    <option value="16" >16</option>
						                                    <option value="17" >17</option>
						                                    <option value="18" >18</option>
						                                    <option value="19" >19</option>
						                                    <option value="20" >20</option>
						                                    <option value="25" >25</option>
						                                    <option value="30" >30</option>
						                                </select>
						                            </td>
						                            <!--这里放上默认的时间-->
						                            <td ><font style="font-weight: bold;">即可发送</font>
						                            	<input type="hidden" id="send_date" 
						                            				 class="inputText" value="<?php echo date( 'Y-m-d',time() );?>">
						                            	
						                            	<select id="send_hour" class="inputText hidden" style="height: 24px;width: 80px;">
						                              	</select>
						                            
						                            </td>
						                            <!--点击删除的话，则把前面的内容清空-->
						                            <td><img 	style="margin:0px 5px;cursor: pointer;" onclick="order_addReceiver(this)"
						                            				src="/Public/Images/global/icon_add.gif" 
						                            				title="添加收礼者！"
						                            				><img 	style="margin:0px 5px;cursor: pointer;" onclick="order_deleteReceiver(this)"
						                            				src="/Public/Images/global/icon_delete.gif" 
						                            				title="删除该收礼者！">
						                            </td>
						                        </tr>
						                       <php>}</php>
						                    </tbody>
						                </table>
					            	</div>  
				           	</div>
				         </div>
					  </div>
					  
					  <div class="clear"></div>
						<!--第一步，编辑发送者和接收者的简单信息-->
				    <div class="step">
				    	<div class="clear"></div>
				        <div class="cont"  id="order_senderinfo">
				        	<div class="clear"></div>
				        	<span style="float:right;margin-top: 5px;">请正确输入您的手机号/姓名，以便对方更好了解礼物来自谁！</span>
				            <h2 class="subStep">二. 填写发送基本信息
				            	<a href="#?width=300" class="jTip" id="tip_two" id="one" rel='sender' name="发送者录入说明:">
				        			<img style="margin:0px 0px 0px 10px;" src="/Public/Images/global/icon_help.gif" >
				              	</a>
				            </h2>
				            <div class="clear"></div>
				            <div class="panel_style1">
				            <div class="clear"></div>
					            <table style="margin: 5px 0px; width: 100%; font-weight: bold;" class="senderInfo">	
					                <colgroup>
					                	  <col width="20px">
					                    <col width="200px">
					                    <col width="200px">
					                    <col width="80px">
					                    <col width="*">
					                </colgroup>
					                <tbody>		
					                    <tr>
					                        <!-- 自动填写使用者真实姓名，但是可以修改 -->
											<td>&nbsp;</td>
					                        <td>
					                           	 送礼人号码：<input type="text" class="inputText" maxLength='11' value="" id="sender_mobile">
					                        </td>
	
					                        <td>送礼人名称：<input type="text" class="inputText" id="sender_name" 
					                        				value="" maxlength="6"></td>
					                        
					                        
					                        <td>
					                        	短信发送<select id="send_format" class="inputText hidden" disabled style="height: 24px; width: 100px;" id="send_type">
										                    <option value="sms" selected>短信发送</option>
										                    <!-- option value="mms">彩信发送</option -->
										                </select>
					                        </td>	
					                    </tr>
					                </tbody>
					            </table>
					            <div class="clear"></div>
				            </div>
				            <div class="clear"></div>
				        </div>
				        <div class="clear"></div>
				        <div id="sender_txt_edit" style="margin-top:10px;">
				        	<div class="clear"></div>
					        <div class="panel_style1">
								  	<div class="panel-title">
								  		<span style="float:right; margin-right: 10px;cursor: pointer;">&nbsp;</span>
								        
								         <ul class="column-tab">
								            <li class="tab-title tab-title-current" rel='edit'>编辑短信</li>
								         </ul>
								      </div>
								      <table class="senderInfo" style="margin:10px 0px;" >	
						                <colgroup>
						                    <col width="75px">
						                    <col width="110px">
						                    <col width="85px">
						                    <col width="110px">
						                    <col width="85px">
						                    <col width="*">
						                </colgroup>	
						                <tbody>		
						                    <tr>
						                        <th style="vertical-align: top;padding-top:5px">短信内容：</th>
						                        <td colspan="5">
						                            <textarea style="width: 300px;" title="短信内容" maxlength='40'
						                            	id="txt_content" class="inputTextarea"></textarea>						
						                            <span style="padding: 0px 0 0 5px;color:blue" name="charcnt" id="charcnt">还可输入<span style="font-size:16px;color:red; font-weight:bold" id="sms_input_no">40</span>字</span>
						                        </td>				
						                    </tr>			
						                </tbody>
						            </table>
						            <div class="clear"></div>
								  </div>
								</div>
				        <!-- 
				        <div id="sender_sms_edit" class='hidden' style="margin-top:10px;">
				        	<php>//$_sms_editer_shelfid=$productdata['shelf_id'];</php>
				         	<//include file="../Public/Js/smsEditer/smsEditer.html" />
				        </div>
				         -->
				    </div>
					
				   
				      
				    <!--第三步，结算信息综合-->
				    <div class="step">
				        <div class="cont">
				        	<span style="float:right;margin-top: 5px;">购买商品信息如下,请确认后支付！</span>
				           	<h2 class="subStep">三. 确认礼物详细账单
				           		<a href="#?width=300" class="jTip" id="tip_three" rel='payment' name="账单说明:">
				        			<img style="margin:0px 0px 0px 10px;"  src="/Public/Images/global/icon_help.gif">
				              	</a>
				            </h2>
				           	<div class="panel_style2">
						    	<div class="summary" >
					         		<table class="paymentInfo" id='paymentinfo'>	
										<colgroup>
							            	<col width="185px">
							                <col width="55px">
							                <col width="*">
							            </colgroup>			
										<tbody>
														<tr style="height:25px;">
															<th >
																您购买的商品账单如下：
															</th>
															<td style="padding-left:10px"></td>
															<td style="padding-left:10px"></td>
														</tr>
														<tr style="height:25px;">
															<th>商品单价：</th>
															<td style='text-align:right;'>
																<strong id="showBuyTotalCnt" class="giftPoint">{$productdata['shelf_out_price']}</strong>
															</td>
															<td style="padding-left:10px">元</td>
														</tr>
														<tr style="height:25px;">
															<th>购买数量：</th>
															<td style='text-align:right;'>
																<strong id="total_send_no" class="giftPoint">0</strong>
															</td>
															<td style="padding-left:10px">个</td>
														</tr>
														<tr style="height:25px;">
															<th>商品总价：</th>
															<td style='text-align:right;'>
																<strong id="total_price" class="giftPoint">0</strong>
															</td>
															<td style="padding-left:10px">元</td>
														</tr>
														<!--
														<tr style="height:25px;">
															<th>获赠积分：</th>
															<td style='text-align:right;'>
																<strong id="total_gain_credit" class="giftPoint">{$productdata['shelf_gain_credit']}</strong>
															</td>
															<td style="padding-left:10px">积分</td>
														</tr>
														-->
														<!--默认为零，最多使用该商品规定的积分额，使用的积分变化，则赠送的积分也跟着变化。-->
														<!--
														<tr style="height:25px;">
															<th>使用积分：</th>
															<td style='text-align:right;'>
																<input id="pointUsed" type="text" style="width:40px" class="inputText" value="0">
															</td>
															<td style="padding-left:10px">你还剩余<span class="giftPoint"> 50</span>个积分</td>
														</tr>
														-->
													</tbody>
									</table>
								</div>
								<div class="total_number" >
									<span>总计：需支付&nbsp;&nbsp;<font id='needed_pay'>99</font>&nbsp;&nbsp;元</span>
								</div>
							</div>
										
					    </div>
					  </div>
					  <div class="step" style="text-align:right;margin: 0 15px;">
						    <input id="goPay" class="btn_r" type="button" onclick="order_submit();" value=" 确定 >>" />
				    </div>
				
			</div>
		</div>
		</div>
</div>
</div>

<!-- 提示信息 每种提示以div保存 通过id 和 处罚提示标签的rel来对应-->
<div id="jTip_info_area" class="hidden">
	<div id="reveiver">
		<div style="line-height:25px">
			 <span>点击<img style="margin:0px 3px;" src="/Public/Images/global/icon_add.gif" >将新增一条收礼人录入栏。</span>
			 <br>
			 <span>点击<img style="margin:0px 3px;" src="/Public/Images/global/icon_delete.gif" >将删除对应收礼人录入栏。</span>
			 <br>
			 <span>“手机号” 为接受礼物者手机号码。</span>
			 <br>
			 <span>“数量” 为送出的商品数量。</span>
			 <br>
			 <span>“发送时间” 为{:K('SP_COUPON_NM')}发送时间。“即刻发送”为订单支付成功后马上发出{:K('SP_COUPON_NM')}。</span>
		</div>
	</div>
	<div id="sender">
		<div style="line-height:25px">
			 <span>“送礼人号码” 为送礼者手机号码。对方将看到的发送者手机号码。</span>
			 <br>
			 <span>“送礼人名称” 为送礼者名称。对方将看到的送礼人名称。</span>
			 <br>
			 <span>“发送方式” 目前只支持短信发送。</span>
			 <br>
			 <span>“短信内容” 在此写你想与TA说的话。例如：祝贺、鼓励、感谢等。</span>
		</div>
	</div>
	<div id="payment">
		<div style="line-height:25px">
			 <span>“商品总价” = “商品单价” X “购买数量”</span>
		</div>
	</div>
</div>

<!-- 用于显示电话薄 -->
<div id="pbook_list" style="border: 1px solid #C5C5C5;display:none;position: absolute; border-radius: 3px 3px 3px 3px;background-color: #FAFAFA;font-weight: bold;font-size:12px; z-index: 9;line-height: 22px; margin-top: 0px; padding: 5px 10px;"></div>
						

<include file="../Public/plugin.footer.html" />